package com.wg.controller;

import com.wg.R;
import com.wg.entity.Depts;
import com.wg.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/depts")
public class DeptController {
    /**
     * web端对部门只需提供一个获取所有部门的接口
     */

    @Autowired
    DeptService deptService;

    @GetMapping
    public R<List<Depts>> getDepts() {
        return deptService.getDepts();
    }
}
